<script>

export default {
    name: 'App',
    components: {},
    data() {
        return {
            name: "李五"
        }
    },
    methods: {
        men(event) {
            console.log(event)
            // 阻止事件冒泡
            event.stopPropagation()

            // 阻止默认行为
            event.preventDefault()
        }
    },
    render(createElement, context) {
        return (
                <div>
                    <h4 vOn:click={this.men}>你好</h4>
                    <br/>
                    <h4 onClick={this.men}>你好</h4>
                    <br/>
                    <div class="title" vOn:click_stop_prevent={this.men}>
                        {/*阻止事件冒泡和默认行为*/}
                    <a vOn:click_stop_prevent={this.men} href="http://www.chengheng.cc">你好</a>
                        <br/>
                        {/*可以通过原生js阻止默认事件和行为*/}
                    <a onClick={this.men} href="http://www.chengheng.cc">你好</a>
                    </div>
                </div>

        )
    }
}
</script>
<style scoped>
.title {
    width: 100px;
    height: 100px;
    background-color: #42b983;
    text-align: center;
    padding-top: 40px;
}
</style>